# Contributor: azmeuk <eloi@yaal.fr>
# Maintainer: azmeuk <eloi@yaal.fr>
pkgname=opensmtpd-filter-senderscore
_pkgname=filter-senderscore
pkgver=0.1.2
pkgrel=13
pkgdesc="OpenSMTPD senderscore filter"
url="https://github.com/poolpOrg/filter-senderscore"
license="ISC"
# s390x, loongarch64: blocked by opensmtpd -> libressl
arch="all !s390x !loongarch64"
options="!check" # No test suite
depends="opensmtpd"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/poolpOrg/filter-senderscore/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
export GOPATH="$srcdir"

build() {
	GO111MODULE=off go build
}

package() {
	install -Dm 0555 "$_pkgname-$pkgver" "$pkgdir"/usr/lib/opensmtpd/"$_pkgname"
}

sha512sums="
92c5e87eb3cd5fdcd1e54e46887ba14e331f665d4edbefc27ce6f0c93f58a60b1e525b696653274cfdd14eaaff4d1e034f92368d5e4a27ecec28ddd951882867  opensmtpd-filter-senderscore-0.1.2.tar.gz
"
